﻿Public Class COperacionesReales
    Implements IOperaciones

    Public Function dividir(ByVal numero1 As Object, ByVal numero2 As Object) As Object Implements IOperaciones.dividir
        If (CDbl(numero2) = 0) Then
            Throw New Exception("Error, no es posible dividir por cero")
        Else
            Return CDbl(numero1) / CDbl(numero2)
        End If
    End Function

    Public Function multiplicar(ByVal numero1 As Object, ByVal numero2 As Object) As Object Implements IOperaciones.multiplicar
        Return CDbl(numero1) * CDbl(numero2)
    End Function

    Public Function restar(ByVal numero1 As Object, ByVal numero2 As Object) As Object Implements IOperaciones.restar
        Return CDbl(numero1) - CDbl(numero2)
    End Function

    Public Function sumar(ByVal numero1 As Object, ByVal numero2 As Object) As Object Implements IOperaciones.sumar
        Return CDbl(numero1) + CDbl(numero2)
    End Function
End Class
